#ifndef GAME_HPP_
#define GAME_HPP_

#include <OGRE/Ogre.h>
#include <OIS/OISKeyboard.h>
#include <OIS/OISMouse.h>
#include <OIS/OISInputManager.h>

#include "gamestate/GameStateManager.hpp"

/**
 * Top level game class.
 *
 * Game logic is handled by game states.
 */
class Game : public OIS::KeyListener, public OIS::MouseListener
{
	public:
		Game();
		~Game();

		bool Init();
		void Run();

		void Exit() { m_Running = false; }

		bool keyPressed(const OIS::KeyEvent &keyEventRef);
		bool keyReleased(const OIS::KeyEvent &keyEventRef);

		bool mouseMoved(const OIS::MouseEvent &evt);
		bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
		bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
	private:
		bool m_Running;

		GameStateManager		m_GSM;
		Ogre::Root*				m_pRoot;

		Ogre::RenderWindow*		m_pRenderWindow;
		Ogre::Viewport*			m_pViewport;

		OIS::InputManager*		m_pInputManager;
		OIS::Keyboard*			m_pKeyboard;
		OIS::Mouse*				m_pMouse;

		Ogre::Log*				m_pLog;

		Ogre::Timer*			m_pTimer;
};

#endif /* GAME_HPP_ */
